import React, { Component } from 'react'
import { NavLink, Switch, Route,Redirect } from 'react-router-dom'
import Goods from '../views/Goods'
import Cate from '../views/Cate'
import Cart from '../views/Cart'
import Mine from '../views/Mine'
import '../css/home.css'
import goodspic from '../static/image/cardnav.png'
import catepic from '../static/image/catepic.png'
import cartpic from '../static/image/cart.png'
import minepic from '../static/image/mine.png'


export default class Home extends Component {
    render() {
        return (
            <div>
                <Switch>
                    <Route path="/home/goods" component={Goods}></Route> 
                    <Route path="/home/cate" component={Cate}></Route> 
                    <Route path="/home/cart" component={Cart}></Route> 
                    <Route path="/home/mine" component={Mine}></Route>
                    <Redirect path='/home' to='/home/goods'></Redirect>
                </Switch>
                <div className='bottom'>
                    <NavLink to="/home/goods" activeStyle={{ background: 'pink', color: 'write' }}><img src={goodspic} alt="" />商城</NavLink>
                    <NavLink to="/home/cate" activeStyle={{ background: 'pink', color: 'write' }}><img src={catepic} alt="" />分类</NavLink>
                    <NavLink to="/home/cart" activeStyle={{ background: 'pink', color: 'write' }}><img src={cartpic} alt="" />购物车</NavLink>
                    <NavLink to="/home/mine" activeStyle={{ background: 'pink', color: 'write' }}><img src={minepic} alt="" />我的</NavLink>
                   
                </div>
            </div>
        )
    }
}
